﻿<visi:VisiDialog x:Class="VNet.VisiSuite.VisiBoard.Views.ChangeoverDialogView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:visi="clr-namespace:VNet.VisiSuite.VisiBoard.Controls"
        xmlns:vuc="clr-namespace:VNet.VisiSuite.Controls;assembly=VNet.VisiSuite.Controls"
        xmlns:vm="clr-namespace:VNet.VisiSuite.VisiBoard.ViewModels" DataContext="{DynamicResource ChangeoverDialogViewModel}"
        xmlns:converter="clr-namespace:VNet.VisiSuite.Common.Converters;assembly=VNet.VisiSuite.Common"
        xmlns:c="clr-namespace:VNet.VisiSuite.VisiBoard.Controls"
        xmlns:helper="clr-namespace:VNet.VisiSuite.VisiBoard.Common.Helpers"
        xmlns:ig="http://schemas.infragistics.com/xaml"
        xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"
        mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800" Loaded="VisiDialog_Loaded"
        >

    <visi:VisiDialog.Resources>
        <vm:ChangeoverDialogViewModel x:Key="ChangeoverDialogViewModel" />
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <converter:InvertBooleanConverter x:Key="InvertBooleanConverter" />
        <converter:InvertBooleanVisibilityConverter x:Key="InvertBooleanVisibilityConverter" />
        <!--
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>

        <Style x:Key="ComboEditorItemControlStyle" TargetType="ig:ComboEditorItemControl">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>
        <Style TargetType="ig:ComboEditorItemControl">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>
        <Style TargetType="ig:XamComboEditor">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>
                -->

        <Style TargetType="{x:Type ig:XamMultiColumnComboEditor}">
            <Setter Property="FontSize" Value="16pt"/>
            <Style.Resources>
                <Style TargetType="{x:Type igPrim:SpecializedTextBox}">
                    <Setter Property="FontSize" Value="16pt"/>
                </Style>
            </Style.Resources>
        </Style>

        <Style TargetType="{x:Type ig:ComboHeaderCellControl}">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>

        <Style TargetType="{x:Type ig:ComboCellControl}">
            <Setter Property="FontSize" Value="16pt"/>
        </Style>
    </visi:VisiDialog.Resources>
    
    <vuc:BusyIndicator IsBusy="{Binding IsBusy}">

        <Border BorderBrush="#FFE7E7E7" BorderThickness="3,0,0,0">

            <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="#FFFBFBFB" Focusable="False">

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <!--Header-->
                <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,8,0,0">
                    <vuc:MetroIconMenu x:Name="_menu" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,0,0"/>
                    <TextBlock Style="{StaticResource AppFontDialogHeader}" VerticalAlignment="Center" Text="{Binding Heading}" Margin="2,0,0,0"></TextBlock>
                </StackPanel>


                <StackPanel Grid.Row="1" Orientation="Vertical" Margin="12,8,12,0">
                    <TextBlock  Style="{StaticResource DialogLabelBlueTextBlockStyle}" FontSize="16pt" Text="Enter your operator ID" />
                    <ig:XamMaskedInput x:Name="_operator_id" Style="{StaticResource PropertyXamMaskedInputStyle}"  Margin="0,0,0,0" SpinButtonDisplayMode="Never"  Mask="nnnnnn"
                        VerticalAlignment="Center" HorizontalAlignment="Left" MinWidth="100" Width="100" AlwaysValidate="False" DisplayMode="Raw" Text="{Binding OperatorCode}">
                    </ig:XamMaskedInput>
                </StackPanel>

                <StackPanel Grid.Row="2" Orientation="Vertical" Margin="12,8,12,0">
                    <TextBlock  Style="{StaticResource DialogLabelBlueTextBlockStyle}" FontSize="16pt" Text="Select the job #" />
                    <ig:XamMultiColumnComboEditor  x:Name="_combo_production_plan" 
                               AutoGenerateColumns="False"
                               AllowMultipleSelection="False"
                               ItemsSource="{Binding Path=ProductionPlanData}"
                               DisplayMemberPath="WorkOrder"
                               SelectedItemsResetButtonVisibility="Collapsed"
                               SelectionChanged="production_OnSelectionChanged" >
                        <ig:XamMultiColumnComboEditor.Columns>
                            <ig:TextComboColumn Key="WorkOrder" HeaderText="Job #" MinimumWidth="130" />
                            <ig:TextComboColumn Key="Sku" HeaderText="SKU" MinimumWidth="130" />
                            <ig:TextComboColumn Key="OperationPass" HeaderText="Pass" MinimumWidth="75" />
                        </ig:XamMultiColumnComboEditor.Columns>
                    </ig:XamMultiColumnComboEditor>
                </StackPanel>

                <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="12,0,12,8">
                    <TextBlock Style="{StaticResource PropertyTextBlockStyle}" FontSize="16pt" Text="SKU: " VerticalAlignment="Center"/>
                    <TextBlock Style="{StaticResource PropertyDataTextBlockStyle}" FontSize="16pt" Text="{Binding SKU}" VerticalAlignment="Center"/>
                </StackPanel>

                <StackPanel Grid.Row="4" Orientation="Horizontal" Margin="12,0,12,8">
                    <TextBlock Style="{StaticResource PropertyTextBlockStyle}" FontSize="16pt" Text="Pass: " VerticalAlignment="Center"/>
                    <TextBlock Style="{StaticResource PropertyDataTextBlockStyle}" FontSize="16pt" Text="{Binding OperationPass}" VerticalAlignment="Center"/>
                </StackPanel>
                
                <StackPanel Grid.Row="5" Orientation="Horizontal" Margin="12,0,12,8">
                    <TextBlock Style="{StaticResource PropertyTextBlockStyle}" FontSize="16pt" Text="Planned: " VerticalAlignment="Center"/>
                    <TextBlock Style="{StaticResource PropertyDataTextBlockStyle}" FontSize="16pt" Text="{Binding Planned}" VerticalAlignment="Center"/>
                </StackPanel>

                <StackPanel Grid.Row="6" Orientation="Horizontal" Margin="12,0,12,8">
                    <TextBlock Style="{StaticResource PropertyTextBlockStyle}" FontSize="16pt" Text="Actual: " VerticalAlignment="Center"/>
                    <TextBlock Style="{StaticResource PropertyDataTextBlockStyle}" FontSize="16pt" Text="{Binding Actual}" VerticalAlignment="Center"/>
                </StackPanel>

                <StackPanel Grid.Row="7" Orientation="Vertical" Margin="12,3,7,8">
                    <TextBlock Style="{StaticResource ErrorTextBlockStyle}" FontSize="16pt" Text="{Binding ValidationError}" TextWrapping="Wrap" />
                </StackPanel>

                <vuc:MetroIconMenu Grid.Row="9" x:Name="_bottom_bar" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="2,0,0,0"/>

            </Grid>
        </Border>
    </vuc:BusyIndicator>
</visi:VisiDialog>
